package cn.baddonkey.superqueryjavasdk.interfaces.impl;

import cn.baddonkey.superqueryjavasdk.interfaces.ModuleConvertInterface;
import cn.baddonkey.superqueryjavasdk.json.JsonParser;
import cn.baddonkey.superqueryjavasdk.json.JsonParserFactory;
import lombok.Getter;
import lombok.Setter;

import java.util.Map;

public class ModuleConvert implements ModuleConvertInterface {
    @Getter
    @Setter
    private JsonParser jsonParser;

    public ModuleConvert() {
        this.jsonParser = JsonParserFactory.newInstance();
    }

    public ModuleConvert(JsonParser jsonParser) {
        this.jsonParser = jsonParser;
    }

    @Override
    public String convert(Map<Object, Object> ret) {
        return jsonParser.to(ret);
    }
}
